<%@ page language="java" import="java.util.*,com.njth.beans.*,com.njth.dao.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
		NewsDAO newsdao= (NewsDAO)DaoConfig.getDao(NewsDAO.class);
		News news = new News();
		int id =Integer.parseInt(request.getParameter("id"));
		news=newsdao.getNews(id);
		//System.out.println(news.getAuthor());
		%>

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>南京同虹科贸，打造专业卫浴系统,TOTO专卖，TOTO洁具。</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<link href="<%=basePath%>com/njth/css/style.css" rel="stylesheet"
			type="text/css" />
		<link href="<%=basePath%>com/njth/css/layout.css" rel="stylesheet"
			type="text/css" />

		<script type="text/javascript">
  			function pageSub(){
  	
  			var msg="";
  			var name=document.updatenews.newstitle.value;
  			var content=document.updatenews.content.value;
  			if(name==""){
  			msg=msg+"新闻标题不能为空！";
  			}
  			if(content==""){
  			msg=msg+"请填写新闻内容！";
  			}
  			if(msg.length>0){
  			alert(msg);
  			}else{
  			document.updatenews.submit();
  			}
  		}
  	</script>

	</head>

	<body id="page7">
		<div id="main">
			<!-- header -->
			<div id="header">
				<!--Valid flash version 8.0-->
				<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24"
					width="980" height="430">
					<param name="movie"
						value="<%=basePath%>com/njth/flash/Header_f8.swf?button=0" />
					<param name="quality" value="high" />
					<param name="menu" value="false" />
					<!--[if !IE]> <-->
					<object data="flash/Header_f8.swf?button=0" width="980"
						height="430" type="application/x-shockwave-flash">
						<param name="quality" value="high" />
						<param name="menu" value="false" />
						<param name="pluginurl"
							value="http://www.macromedia.com/go/getflashplayer" />
						FAIL (the browser should render some flash content, not this).
					</object>
					<!--> <![endif]-->
				</object>
			</div>
			<!-- content -->
			<div id="content">
				<div class="bgd">
					<div class="inner">
						<div class="extra">
							<a href="#"><img alt=""
									src="<%=basePath%>com/njth/images/ing.jpg" /> </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a href="#"><img alt=""
									src="<%=basePath%>com/njth/images/banner2.jpg" /> </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a href="#"><img alt=""
									src="<%=basePath%>com/njth/images/banner3.jpg" /> </a>
						</div>
						<div class="article">
							<div class="indent">
								<h2>
									<p align="center">
										修改新闻
									</p>
								</h2>
								<form name="updatenews" method="post"
									action="<%=basePath%>servlet/NewsUpdate" enctype="multipart/form-data">
									<p>
										<font color="#3399cc">请更换新闻标题:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text"
											name="newstitle" id="newstitle" value="<%=news.getTitle() %>"></font> &nbsp;&nbsp;
									</p>
									<p>
										<font color="#3399cc">重新填写新闻内容：
										</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</p>
									<p>
										<font color="red">注:内容应长于十字段！&nbsp;&nbsp; <textarea
											name="content" name="content" rows="6" cols="60"><%=news.getContext() %></textarea></font>
										&nbsp;&nbsp;
									</p>
									<p>
										<font color="#3399cc">更换新闻图片:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
										
										<input type="file" name="file2" id="file2" ></font> &nbsp;&nbsp;
									</p>
									<p align=center>
										<input type="button" value="提交" onclick=pageSub();>
											&nbsp;&nbsp;&nbsp; 
										<input type="reset" value="重填">
									</p>
									<p align="right">
										<a href="<%=basePath%>com/njth/jsp/nmanager.jsp">返回</a>
									</p>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- footer -->
			<div id="footer">
				<div class="fleft">
					NJTOTO &copy; 2009 | All right
					reserved&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="<%=basePath%>com/njth/jsp/administrator.jsp">登录</a>&nbsp;|
					<a href="http://mail.njtoto.com">邮箱</a>
				</div>

			</div>
		</div>
	</body>
</html>